From: Lars Ingebrigtsen Date: Sat, 4 Dec 2021 04:39:25 +0000 (+0100) Subject: Make the error message in epa-display-error more helpful X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~4058^2~5 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=644dd2f05059401116caf6c6e3574a2ac763e667;p=emacs.git Make the error message in epa-display-error more helpful * lisp/epa.el (epa-display-error): Output a more helpful error message when reading a keyring file (bug#12923). --- diff --git a/lisp/epa.el b/lisp/epa.el index e4b89e984d2..93c85bfd37c 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -607,7 +607,11 @@ If SECRET is non-nil, list secret keys instead of public keys." (_ "Error while executing \"%s\":\n\n")) (epg-context-program context)) "\n\n" - (epg-context-error-output context))) + (epg-context-error-output context) + (if (string-search "Unexpected error" + (epg-context-error-output context)) + "\n(File possibly not an encrypted file, but is perhaps a key ring file?)\n" + ""))) (epa-info-mode) (goto-char (point-min))) (display-buffer buffer)))))